var geoCoordMap = {
    '咸阳': [108.4131,34.8706],
    '宝鸡': [107.1826,34.3433],
    '延安': [109.1052,36.4252],
    '渭南': [109.7864,35.0299],
    '西安': [108.906489,34.240068],
    '安康': [109.029022,32.684714],
    '高陵': [108.862524,34.163328],
    '蓝田': [109.323479,34.151624],
    '临潼': [109.214238,34.367275],
    '周至': [108.222154,34.163621],
    '鄠邑区': [108.626575,34.093558],
    '新城区西影路': [108.874913,34.230797],
    '未央区明光路': [108.940174,34.341568],
    '雁塔区劳动南路': [108.874913,34.230797],
    '陕西省西安市周至县集贤镇科技大道1号': [108.386383,34.066757],
    '陕西省西安市长安区王曲街道238乡道': [108.962251,34.09397]
};


function getEcharts(){
    require.config({
        paths: {
            echarts: './js'
        }
    });
    require(
        [
            'echarts',
            'echarts/chart/map'
        ],
        function (ec) {
            // --- 地图 ---
            var myChart2 = ec.init(document.getElementById('mainMap'));
            myChart2.setOption({
                series : [
                    {
                        name: '全国',
                        type: 'map',
                        roam: true,
                        hoverable: false,
                        mapType: '陕西|西安市',
                        roam: true,
                        itemStyle:{
                            normal:{
                                label:{show:true},
                                borderWidth:1,
                                areaStyle:{
                                    color: 'rgba(58, 202, 246,0)',
                                }
                            },
                        },

                        data:[
                            {name: '西安市',value: Math.round(Math.random()*1000)},
                        ],
                        markLine : {
                            smooth:true,
                            effect : {
                                show: true,
                                scaleSize: 1,
                                period: 20,
                                color: 'orange',
                                shadowBlur: 5
                            },
                            symbol: ['none', 'circle'],
                            itemStyle : {
                                normal: {
                                    borderWidth:1,
                                    lineStyle: {
                                        color:'yellow',
                                        opacity: 0.6,
                                        curveness: 0.2,
                                        width: 1,
                                    }
                                }
                            },
                            data : [
                                [{name:'西安'},{name:'周至',value:''}],
                                [{name:'西安'},{name:'临潼',value:''}],
                                [{name:'西安'},{name:'蓝田',value:''}],
                                [{name:'西安'},{name:'鄠邑区',value:''}],
                                [{name:'西安'},{name:'陕西省西安市长安区王曲街道238乡道',value:''}],
                            ],
                        },
                        geoCoord:geoCoordMap,
                        markPoint : {
                            symbol:'emptyCircle',
                            symbolSize : function (v){
                                return 10 + v/10
                            },
                            effect : {
                                show: true,
                                shadowBlur : 0,
                                color:'yellow'
                            },
                            itemStyle:{
                                normal:{
                                    label:{show:false}
                                },
                                emphasis: {
                                    label:{position:'top'}
                                }
                            },
                            data : [
                                {name:'周至',value:''},
                                {name:'临潼',value:''},
                                {name:'蓝田',value:''},
                                {name:'鄠邑区',value:''},
                                {name:'陕西省西安市长安区王曲街道238乡道',value:''},
                            ]
                        }
                    }

                ]
            });
        });
}